package org.csu.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import org.csu.demo.domain.OrderStatus;
import org.csu.demo.persistence.OrderStatusMapper;
import org.csu.demo.service.OrderStatusService;
import org.springframework.stereotype.Service;

@Service("orderStatusService")
public class OrderStatusServiceImpl extends MppServiceImpl<OrderStatusMapper, OrderStatus> implements OrderStatusService {

    //根据复合主键查询订单状态表
    @Override
    public OrderStatus getOrderStatusByCompositeKey(int orderId, int lineNumber) {
        QueryWrapper<OrderStatus> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("orderid", orderId).eq("linenum", lineNumber);
        return this.getOne(queryWrapper); // 根据条件查询单条数据
    }
}
